/**
 * 支付相关API类型定义
 */

export interface PaymentOrder {
  id: string;
  consultId: string;
  userId: string;
  amount: number;
  paymentMethod: 'wechat' | 'alipay' | 'card' | 'balance';
  status: 'pending' | 'paid' | 'failed' | 'cancelled' | 'refunded';
  createdAt: string;
  paidAt?: string;
  refundedAt?: string;
  orderNo: string;
  transactionId?: string;
}

export interface CreatePaymentParams {
  consultId: string;
  amount: number;
  paymentMethod: 'wechat' | 'alipay' | 'card' | 'balance';
  returnUrl?: string;
  notifyUrl?: string;
}

export interface PaymentStatusResponse {
  status: string;
  order: PaymentOrder;
  paymentUrl?: string;
  qrCode?: string;
}

export interface PaymentHistoryParams {
  page?: number;
  limit?: number;
  status?: string;
  startDate?: string;
  endDate?: string;
}

export interface PaymentHistoryResponse {
  list: PaymentOrder[];
  total: number;
  page: number;
  limit: number;
}

export interface RefundParams {
  paymentId: string;
  amount?: number;
  reason: string;
}

export interface RefundResponse {
  refundId: string;
  status: 'processing' | 'success' | 'failed';
  refundAmount: number;
  estimatedTime?: string;
}
